package se.webbzon.oschi01.generic;

import java.lang.reflect.Method;

public abstract class Generic<T> {

	@SuppressWarnings("unchecked")
	public Class<T> classOf() {
		foo();
		Class<T> clazz = null;
		try {
			Method m = getClass().getDeclaredMethod("foo");
			clazz = (Class<T>) m.getReturnType();
		} catch (Exception e) {
			// Do nothing
		}
		return clazz;
	}
	
	protected T foo() {
		return null;
	}

}
